﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HomePage.aspx.cs" Inherits="SAD_Assignment1.HomePage" MasterPageFile="~/Shared/Site1.Master" %>

<asp:Content ContentPlaceHolderID="head" runat="server">
    <title>Home Page</title>
</asp:Content>
<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="container">
        <asp:DataList ID="grid" runat="server" RepeatColumns="1" DataKeyField="ID">
            <ItemTemplate>
                <div class="row">
                    <div class="col-sm-6 col-md-3">
                        <asp:HyperLink ID="Image1" ImageUrl='<%# DataBinder.Eval(Container.DataItem,"URL")%>' runat="server"
                            Target="_blank" NavigateUrl='<%#Eval("ID","~/Public/ViewPhoto.aspx?ID={0}")%>' CssClass="thumbnail" />
                    </div>
                    <div class="col-sm-6 col-md-3 photo-description">
                        <h3>
                            <asp:HyperLink runat="server" NavigateUrl='<%#Eval("ID","~/Public/ViewPhoto.aspx?ID={0}")%>' Target="_blank">
                                <%# DataBinder.Eval(Container.DataItem,"Title")%>
                            </asp:HyperLink>
                        </h3>
                        <div>
                            Đăng bởi
                            <asp:HyperLink ID="HyperLink1" runat="server" Target="_blank" 
                                NavigateUrl='<%#SAD_Assignment1.Shared.Resource.UserInfo+"?ID="+Eval("AccID") %>'>
                                <%# DataBinder.Eval(Container.DataItem,"AccName")%>
                            </asp:HyperLink>
                        </div>
                        <div>
                            Vào lúc <%# DataBinder.Eval(Container.DataItem,"PostDate")%>
                        </div>
                        <asp:HiddenField runat="server" ID="hiddenID" Value='<%#Eval("ID") %>' />
                        <div>
                            Số người Thích:
                            <asp:Label runat="server" ID="likeCountLB" Text="0" OnLoad="likeCountLB_Load" />
                        </div>
                        <div>
                            Số người không thích:
                            <asp:Label runat="server" ID="unlikeCountLB" Text="0" OnLoad="unlikeCountLB_Load" />
                        </div>
                    </div>
                </div>
            </ItemTemplate>
        </asp:DataList>

        <asp:Button runat="server" CssClass="btn btn-info" Text="Xem thêm Photo VL" Width="400px" Font-Size="X-Large"
            Style="margin-left: 25%" ID="NextPageBtn" OnCommand="NextPageBtn_Command" />
    </div>
</asp:Content>
